home *** CD-ROM | disk | FTP | other *** search
- global gWorld, gCar, gCamera, gCarModel, gCarInfo, gTransFormat, gSolidFormat, gTargetPoints, gHaveCPU, gSparkLocs, gSparkCount, gSparkSystems, gTimeStep, gHaveSound, gFinished, gCollDetails, gLastTrackCollision, gLastCarCollision, gCarAttributes, gCurrentVel, gPowerupList, gRemovedPowerups, gCurrTrack, gTimeInfo, gNumLaps
-
- on stopSounds
- repeat with i = 1 to 8
- sound(i).stop()
- sound(i).volume = 255
- sound(i).pan = 0
- end repeat
- end
-
- on chooseRenderer whichStyle
- rs = getRendererServices()
- AvailableList = rs.rendererDeviceList
- if whichStyle = #NonDTS then
- if getOne(AvailableList, #openGL) then
- rs.renderer = #openGL
- else
- rs.renderer = #software
- end if
- else
- if whichStyle = #DTS then
- if getOne(AvailableList, #directX7_0) then
- rs.renderer = #directX7_0
- else
- if getOne(AvailableList, #openGL) then
- rs.renderer = #openGL
- else
- if getOne(AvailableList, #directX5_2) then
- rs.renderer = #directX5_2
- else
- rs.renderer = #software
- end if
- end if
- end if
- else
- put "Unknown which style for chooseRenderer" && whichStyle
- end if
- end if
- end
-
- on initializeTrackGlobals
- gWorld.resetWorld()
- gFinished = 0
- gCollDetails = []
- gLastTrackCollision = 0
- gLastCarCollision = 0
- gSparkLocs = []
- gSparkSystems = []
- gSparkCount = 0
- gPowerupList = []
- gRemovedPowerups = []
- gCurrentVel = vector(0, 0, 0)
- gNumLaps = 2
- end
-
- on initializeGlobals
- gTimeInfo = [0, 0]
- gWorld = member("3DWorld")
- gCurrTrack = 0
- gTimeStep = 0.0333
- gCarAttributes = [:]
- addProp(gCarAttributes, #speed, [#min: 1450.0, #max: 1600.0])
- addProp(gCarAttributes, #brake, [#min: 0.0035, #max: 0.0065])
- addProp(gCarAttributes, #acceleration, [#min: 0.0035, #max: 0.0065])
- addProp(gCarAttributes, #turning, [#min: 525.0, #max: 1125.0])
- texFormatList = getRendererServices().getHardwareInfo().supportedTextureRenderFormats
- gSolidFormat = VOID
- if getOne(texFormatList, #rgba5550) then
- gSolidFormat = #rgba5550
- else
- if getOne(texFormatList, #rgba5650) then
- gSolidFormat = #rgba5650
- else
- if getOne(texFormatList, #rgba8880) then
- gSolidFormat = #rgba8880
- else
- put "No Solid Format available"
- end if
- end if
- end if
- gTransFormat = VOID
- if getOne(texFormatList, #rgba8888) then
- gTransFormat = #rgba8888
- else
- if getOne(texFormatList, #rgba4444) then
- gTransFormat = #rgba4444
- else
- if getOne(texFormatList, #rgba5551) then
- gTransFormat = #rgba5551
- else
- put "No Transparent format"
- end if
- end if
- end if
- if voidp(gSolidFormat) then
- gSolidFormat = gTransFormat
- end if
- if voidp(gTransFormat) then
- gTransFormat = gSolidFormat
- end if
- getRendererServices().textureRenderFormat = gSolidFormat
- if the controlDown and (the runMode = "Author") then
- gHaveCPU = 0
- else
- gHaveCPU = 1
- end if
- end
-
- on preloadModels
- member("Building01").preload()
- member("Building02").preload()
- member("TrackTestBig").preload()
- end
-
- on ResetCamera
- global gTrailPlane, gTS
- gCamera = gWorld.camera(1)
- gCamera.yon = 5100
- if (getRendererServices().renderer <> #directX5_2) and (getRendererServices().renderer <> #software) then
- gCamera.fog.enabled = 1
- gCamera.fog.far = 5000
- gCamera.fog.near = 2000
- gCamera.fog.color = rgb("#000033")
- gCamera.fog.decayMode = #exponential2
- end if
- tp = gWorld.newModelResource("TrailPlaneResource", #plane)
- tp.widthVertices = 2
- tp.lengthVertices = 2
- tp.width = 20
- tp.length = 20
- gTrailPlane = gWorld.newModel("TrailPlaneModel", tp)
- gTrailPlane.transform.position = vector(0, 0, -1.5)
- gTrailPlane.parent = gCamera
- ps = gTrailPlane.shader
- ps.blend = 13
- ps.texture = VOID
- ps.ambient = rgb(0, 0, 0)
- ps.diffuse = rgb(0, 0, 0)
- gTS = ps
- gCamera.colorBuffer.clearAtRender = 1
- end
-